home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / sound / aiff writer sdev / aiff_writer.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  2.3 KB  |  65 lines

  1. /*
  2.     File:        AIFF_writer.h
  3.  
  4.     Contains:    Header for routines which deal with virtual sound hardware from a
  5.                 'sdev' component.
  6.  
  7.     Written by: Mark Cookson    
  8.  
  9.     Copyright:    Copyright © 1993-1999 by Apple Computer, Inc., All Rights Reserved.
  10.  
  11.                 You may incorporate this Apple sample source code into your program(s) without
  12.                 restriction. This Apple sample source code has been provided "AS IS" and the
  13.                 responsibility for its operation is yours. You are not permitted to redistribute
  14.                 this Apple sample source code as "Apple sample source code" after having made
  15.                 changes. If you're going to re-distribute the source, we require that you make
  16.                 it clear in the source that the code was descended from Apple sample source
  17.                 code, but that you've made changes.
  18.  
  19.     Change History (most recent first):
  20.                 8/16/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  21.                 
  22.  
  23. */
  24.  
  25. #ifndef __AIFFWRITER__
  26. #define __AIFFWRITER__
  27.  
  28. #define kHackBlasterSifterID    128
  29. #define kHackBlasterPanelID        130
  30. #define kHackBlasterSubType        'hack'                /* OS Type for component */
  31.  
  32. #ifndef forRez
  33.  
  34.     #include <Components.h>
  35.  
  36. enum {
  37.     kSampleSizesCount = 2,                            /* no. sample sizes supported */
  38.     kSampleRatesCount = 6,                            /* no. sample rates supported */
  39.     kChannelsCount = 2                                /* no. channels supported */
  40. };
  41.  
  42. /* hardware configuration structure */
  43.  
  44. typedef struct {
  45.     long            volume;                            // current hardware volume
  46.     UnsignedFixed    sampleRate;                        // current sample rate
  47.     short            sampleSize;                        // current sample size
  48.     short            numChannels;                    // current num channels
  49.     short            bufferSize;                        // size of interrupt buffer in samples
  50.     Boolean            supportsRateRange;                // true if sample rate range supported, false if only discreet rates supported
  51.     Boolean            outputToFile;                    // true to output sound data to AIFF file
  52.     Boolean            outputToHardware;                // true to play sound
  53.     Boolean            dirty;                            // true if globals need to be saved in prefs file
  54.     short            sampleSizes[kSampleSizesCount];
  55.     short            sampleSizesActive[kSampleSizesCount];
  56.     unsigned long    sampleRateMin;
  57.     unsigned long    sampleRateMax;
  58.     unsigned long    sampleRates[kSampleRatesCount];
  59.     short            sampleRatesActive[kSampleRatesCount];
  60.     short            channels[kChannelsCount];
  61.     short            channelsActive[kChannelsCount];
  62. } HardwareGlobals, *HardwareGlobalsPtr;
  63.  
  64. #endif /* forRez */
  65. #endif /* __AIFFWRITER__ */